import Vue from 'vue'
import App from './App.vue'
import 'element-ui/lib/theme-chalk/index.css';
import ElementUI from 'element-ui';
import VueRouter from 'vue-router'
import router from './routes'; //router里面index.js
import store from './store';
import "./utils/axios.intercepter"

import * as echarts from 'echarts'

Vue.prototype.$echarts = echarts //挂载到Vue实例上面


Vue.use(ElementUI);
Vue.use(VueRouter);

Vue.config.productionTip = false

store.dispatch("userStore/verify"); //一开始就调用verify函数验证token 如果你之前已经登录过 本地已经有token 下次直接进行验证 就能显示登录成功的页面
store.dispatch("postStore/getPostsAsync");

new Vue({
  render: h => h(App),
  router,store
}).$mount('#app')
